export default {
	title:'所有诊断的病例数',
	// columns: 24,
	query: {
		url: 'doctor/statistic?type=6',
		method: 'GET',
		transfer: true
	},
	options: {
		tooltip: {},
		color: ['#7fae90'],
		legend: {
			data: ['诊断病例数量'],
			// tooltip: {
			// 	show: true
			// }
		},
		grid: {
			containLabel: false,
			bottom:100
		},
		dataZoom: {
			height:20,
			start: 0,
			end: 100,
			bottom:'25px',
			backgroundColor: '#eee',
			dataBackgroundColor: '#ccc',
			fillerColor: 'rgba(50,170,205,0.4)',
			handleColor: 'rgba(70,130,180,0.8)',
			show: true
		},
		xAxis: {
			data: [],	// x-axis数据默认为空，因为该数据是查询获得的
			calculable: true,
			axisLabel : {
				interval: 0,
				rotate: 13,
				textStyle: {
					fontFamily : 'STHeiti',
					fontSize : '10',
					color:"#000000"
				},
				}
		},
		yAxis: {
			type : 'value',
			axisLabel: {
				textStyle: {
					fontSize: 14
				}
			},
		},

		series: [
			{
				name: '诊断病例数量',	// 对于单数据的图表，wt-charts组件会自动更新到series[0]
				type: 'bar',	// 在此指定图表类型
				data: [],	// 默认为空，因为该数据是查询所得
				barWidth: '40%',
			}],
	},
	customData(data){
		let dataZooms = 0;
		let series = [];
		let xAxis = [];
		let percent = 6/(data.length-1);
		if (1<percent||percent<0){
			dataZooms = 100
		}else {
			dataZooms = percent*100
		}
		for (let item = 0 ;item < data.length; item++) {
			for(let i in data[item]) {
				if (i == 'total_num'){
					continue;
				}
				xAxis.push(i);
				series.push(data[item][i]);
			}
		}
		let options = {
			dataZoom:{
				end:dataZooms
			},
			xAxis: {
				data: xAxis,
			},
			series: [{
				name: '诊断病例数量',
				data: series
			}],
		};
		return options;
	}
}